export type DeleteApiApiV1AccountsAccountIdSessionsArgs = {account_id: string}; export type DeleteApiApiV1AccountsAccountIdSessionsOptions = {baseUrl?: string | undefined, JWTAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * StopSession endpoint * * DELETE /api/v1/accounts/{{account_id}}/sessions */ export const deleteApiApiV1AccountsAccountIdSessions = async (args: DeleteApiApiV1AccountsAccountIdSessionsArgs, options?: DeleteApiApiV1AccountsAccountIdSessionsOptions) => { const {baseUrl = "https://edge-gsc.api.brightcove.com", fetch: fetchFn = fetch, JWTAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (JWTAuth !== undefined) headers.set("Authorization", JWTAuth) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/accounts/${encodeURIComponent(String(args['{account_id']))}}/sessions${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };